#include "conversegroupconversation.h"
#include "account/accountmember.h"
#include "contact/contactgroupcontact.h"


namespace Converse {

GroupConversation::GroupConversation(qint64 id,
                                     Contact::GroupContact *contact,
                                     QObject *parent) :
    Converse::AbstractConversation(id, contact, parent)
{
}


GroupConversation::~GroupConversation()
{

}


AbstractConversation::Type GroupConversation::type() const
{
    return AbstractConversation::GroupType;
}


qint64 GroupConversation::toId() const
{
    return id();
}


Contact::GroupContact *GroupConversation::groupContact() const
{
    Contact::AbstractContact *abstractContact = contact();
    if (abstractContact == NULL)
        return NULL;

    Contact::GroupContact *groupContact = \
            dynamic_cast<Contact::GroupContact *>(abstractContact);
    if (groupContact == NULL)
        return NULL;

    return groupContact;
}

} // namespace Converse
